package com.xiao.service.Impl;

import com.xiao.dao.ResponseMessageMapper;
import com.xiao.pojo.Message;
import com.xiao.service.ResponseMessageService;
import com.xiao.util.PublishUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

@Service
public class ResponseMessageServiceImpl implements ResponseMessageService {
    @Autowired
    private ResponseMessageMapper responseMessageMapper;

    //    根据uid显示所有消息
    @Override
    public List<Message> queryAllMessage(long uid) {
        return responseMessageMapper.queryAllMessage(uid);
    }

    //    根据uid显示通知
    @Override
    public List<Message> queryNotMessage(long uid) {
        return PublishUtil.filterMessage("通知",uid,responseMessageMapper);
    }

    //    根据uid显示打卡
    @Override
    public List<Message> queryCloMessage(long uid) {
        return PublishUtil.filterMessage("打卡",uid,responseMessageMapper);
    }

    //    根据uid显示讨论
    @Override
    public List<Message> queryDisMessage(long uid) {

        return PublishUtil.filterMessage("讨论",uid,responseMessageMapper);
    }

    //    根据uid显示调查
    @Override
    public List<Message> queryExmMessage(long uid) {
        return PublishUtil.filterMessage("调查",uid,responseMessageMapper);
    }






}
